import { Notification } from 'element-ui'
import { isString } from 'lodash'

const notify = {
  success (config) {
    if (isString(config)) {
      config = {message: config}
    }
    config = {title: '恭喜', ...config, type: 'success'}
    Notification(config)
  },
  warning (config) {
    if (isString(config)) {
      config = {message: config}
    }
    config = {title: '警告', ...config, type: 'warning'}
    Notification(config)
  }
}

export default notify
